<%= stylesheet_link_tag "contest" %>

<h1>Contests</h1>

<table class="list_table">
  <tr>
    <th>Name</th>
    <th>Start Time</th>
    <th>End Time</th>
  </tr>

<% for contest in @contests %>
  <tr>
    <td><%= link_to contest.name, contest %></td>
    <td><%= contest_date(contest.start_time) %></td>
    <td><%= contest_date(contest.end_time) %></td>
    <% if admin? %>
        <td><%= link_to 'Edit', edit_contest_path(contest) %></td>
        <td><%= link_to 'Destroy', contest, :confirm => 'Are you sure?', :method => :delete %></td>
    <%end%>
  </tr>
<% end %>
</table>

<br />

 <% if admin? %>
    <%= link_to 'New contest', new_contest_path %>
 <%end%>
